//10 9WA
#include"bits/stdc++.h"
using namespace std;
struct interviewee{
	int k,s;
};
int m,n,h;
int main()
{
	cin>>n>>m;
	interviewee volunteer[n+1];
	for(int i=1;i<=n;i++)
	{
		cin>>volunteer[i].k>>volunteer[i].s;
	}
	for(int i=1;i<n;i++)
	{
		for(int j=1;j<=n-i;j++)
		{
			if(volunteer[j].s<volunteer[j+1].s)
			{
				swap(volunteer[j],volunteer[j+1]);
			}
			if(volunteer[j].s==volunteer[j+1].s)
			{
				if(volunteer[j].k>volunteer[j+1].k)
				{
					swap(volunteer[j],volunteer[j+1]);
				}
			}
		}
	}
	int admission_score_line_last_people=ceil(m*1.5);
	int admission_score_line=volunteer[admission_score_line_last_people].s;
	for(int i=1;i<=admission_score_line_last_people;i++)
	{
		if(volunteer[i].s>=admission_score_line)
		{
			h+=1;
		}
	}
	cout<<admission_score_line<<" "<<h<<endl;
	for(int i=1;i<=admission_score_line_last_people;i++)
	{
		cout<<volunteer[i].k<<" "<<volunteer[i].s<<endl;
	}
}
